package mobao.baseinfo.user.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import mobao.utils.R;
import mobao.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@CrossOrigin
@RequestMapping(value = "/demo")
@RestController
@Api(value="杨洪权测试demo",tags={"用户测试接口"})
public class DemoController {

        @Autowired
        private RedisUtils util;

        @ApiOperation(value="杨洪权查询DEMO", notes="输入内容为返回内容")
        @RequestMapping(value = "/redisSet",method = RequestMethod.GET)
        @ResponseBody
        public Map setThing(String key,String msg,long time){
            util.set(key,msg,time);
            return R.ok();
        }
    @ApiOperation(value="杨洪权查询DEMO", notes="输入内容为返回内容")
    @RequestMapping(value = "/redisGet",method = RequestMethod.GET)
    @ResponseBody
    public Object getThing(String key){
        Object o =util.get(key);
        return o;
    }

}
